﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XPathAutoSuggest {
    /// <summary>
    /// Interface hosts commands that are typical for an application that has File IO commands such as New, Open, Save, Save As, Close
    /// </summary>
    /// <remarks>
    /// From SOLID programming practices: "Depend upon Abstractions. Do not depend upon concretions.”
    /// Also, "many client specific interfaces are better than one general purpose interface."
    /// </remarks>
    public interface IFileIoCommands {
        /// <summary>Whether the New command can fire</summary>
        /// <returns>True/false</returns>
        bool NewCanExecute();
        /// <summary>Starts over with empty XML</summary>
        void NewExecute();

        /// <summary>Whether user can open a new XML file</summary>
        /// <returns>true</returns>
        bool OpenCommandCanExecute();
        /// <summary>Opens a new XML file, working with user to browse</summary>
        void OpenCommandExecute();

        /// <summary>Whether user can execute the SaveAs command</summary>
        /// <returns>true/false</returns>
        bool SaveAsCommandCanExecute();
        /// <summary>Saves users' XML after prompting user for new file name</summary>
        void SaveAsCommandExecute();

        /// <summary>Whether user can save their XML</summary>
        /// <returns>True/false</returns>
        bool SaveCommandCanExecute();
        /// <summary>Saves users' XML</summary>
        void SaveCommandExecute();

        /// <summary>Whether user can close the app</summary>
        /// <returns>true</returns>
        bool CloseCommandCanExecute();
        /// <summary>Raises an event that can be caught by the View instructing it to close the app</summary>
        void CloseCommandExecute();
    }
}
